# 以下是第一阶段构建
#FROM python:3.10.0-slim
#LABEL MAINTAINER="zhuqingchuang"
#RUN apt-get update && apt-get install -y gcc && apt-get install -y nginx
#RUN apt-get update && apt-get install  -y nginx
#ENV APP_HOME=/var/www/html/django
#RUN mkdir -p $APP_HOME
#WORKDIR $APP_HOME
#COPY requirements.txt .
#COPY ./nginx/nginx.conf /etc/nginx/
#RUN pip  --no-cache-dir install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/
#RUN pip install uwsgi
#RUN pip  --no-cache-dir install uwsgi -i https://mirrors.aliyun.com/pypi/simple/
#RUN rm -rf /var/cache/apk/*
# 以下是第二阶段构建
#FROM registry.cn-hangzhou.aliyuncs.com/zhuqingchuang/xxjstk:django-base-2024-8-7-4
#RUN apt-get update && apt-get install -y \
#    pandoc wkhtmltopdf \
#    && apt-get clean \
#    && rm -rf /var/lib/apt/lists/*
#RUN pip install --no-cache-dir \
#    python_dotenv==1.1.0 \
#    alibabacloud_ocr_api20210707==3.1.3 \
#    alibabacloud_darabonba-stream==0.0.2 \
#    qrcode==8.2 \
#    pypandoc==1.15 \
#    pdfkit==1.0.0 \
#    -i https://mirrors.aliyun.com/pypi/simple/ && \
#    rm -rf /var/cache/apk/* && \
#    rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# 以下是第三阶段构建
FROM registry.cn-hangzhou.aliyuncs.com/zhuqingchuang/xxjstk:django-base-2025-6-19
ENV APP_HOME=/var/www/html/django
COPY . /var/www/html/django
COPY ./nginx/nginx.conf /etc/nginx/
COPY ./.env.example /var/www/html/django/.env
WORKDIR $APP_HOME
RUN rm -rf /etc/nginx/nginx.conf && \
    rm -rf .git && \
    rm -rf /var/www/html/django/static/images/* && \
    mkdir -p static_new && \
    chmod +x ./start.sh
EXPOSE 8000